UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FjHzJN4/0g5EfbRARDaEC4d235909Y24Bx302NUxswU=' 
WHERE 
  key_id = 'cc485fd39c91d71b18aa113677b571b54d018db74249385028a345b63c1a619d' 
  AND (
    token = 'FjHzJN4/0g5EfbRARDaEC4d235909Y24Bx302NUxswU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029