UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gfooMRuJqZsskRkLWTgGFIyu8WzaWQ/ipt32DUodB4w=' 
WHERE 
  key_id = '5f4d5e9a3cdc697509409a75f63fa8a0230c896f05250ab1b40c68e587722070' 
  AND (
    token = 'gfooMRuJqZsskRkLWTgGFIyu8WzaWQ/ipt32DUodB4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029