UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c2GbHPSH9c69Vu3+Be9ttBruW8aH4swdFCk5d532tXQ=' 
WHERE 
  key_id = '00986103db8c110b4b93b9c4df248ce63be412fa00d925e3d8368d5148bc7ac7' 
  AND (
    token = 'c2GbHPSH9c69Vu3+Be9ttBruW8aH4swdFCk5d532tXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027