UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's7W+hNrFNOtl+Vf7AiBGLje+LqBZJZ1ps0d5YKHEvYE=' 
WHERE 
  key_id = '88c49876816b0fa36011d3eaff28f6e267108d6e61dc01839b6010da67365012' 
  AND (
    token = 's7W+hNrFNOtl+Vf7AiBGLje+LqBZJZ1ps0d5YKHEvYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021