UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UybEQ3Altt4MZyzkzZGEOv5sP+7YmixLUdlxkKVcYJ8=' 
WHERE 
  key_id = '7b0070ec7673b5ba404c52a7c60e7b5268ee213150c41ab63ab7712b1009250a' 
  AND (
    token = 'UybEQ3Altt4MZyzkzZGEOv5sP+7YmixLUdlxkKVcYJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025