UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EvuLz+A7AkX0rOZLWaqhqHLK3bCUAz+FxWQPX1uktkI=' 
WHERE 
  key_id = 'c015c4293a4214f9dd343ac007a833c86b35bcb0a633d2338f1e44243df8feab' 
  AND (
    token = 'EvuLz+A7AkX0rOZLWaqhqHLK3bCUAz+FxWQPX1uktkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028