UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YSFPZ2FaU+HTioW1afFHfvI1avr77qhaC6uGfVm1RoM=' 
WHERE 
  key_id = '6886da7239a9dcd3d17681bab0228549589adfd3f22b680f8a28f3029beb04ad' 
  AND (
    token = 'YSFPZ2FaU+HTioW1afFHfvI1avr77qhaC6uGfVm1RoM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034