UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yYk1nkRy6HskQ/slSmMAI3a0adLgrmZ217UwG3q8Ryw=' 
WHERE 
  key_id = 'ef9746c07f3cceda05bb37d46681760b11d1ecd26e4aa018dcd546ce758255c4' 
  AND (
    token = 'yYk1nkRy6HskQ/slSmMAI3a0adLgrmZ217UwG3q8Ryw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032