UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBRfT9QqXZI9bspFdZcTypxF5ywyi7PLCKLaazrkxeU=' 
WHERE 
  key_id = '6bccfedff7a940dcba1c7cbc5a4e6da643849e1c37630b5dc2701c1a19407709' 
  AND (
    token = 'MBRfT9QqXZI9bspFdZcTypxF5ywyi7PLCKLaazrkxeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00077