UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RmFkSVn3otNNtdkvY2PkyES8z/kK4EphkVwimG9lwnQ=' 
WHERE 
  key_id = '565e972d057a88a5bd1b4a9c76c96b849b7b13fd2ac7fd1fc9dd1466e52022fe' 
  AND (
    token = 'RmFkSVn3otNNtdkvY2PkyES8z/kK4EphkVwimG9lwnQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024