UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kYmpbmfkaLN3J9ot4Ju9nwgK2Qw9QQN6lxH/O+Cga1Q=' 
WHERE 
  key_id = '202c6e1a5b895f791a0547196c84b661119f3a5461495e9c81939b8eccc05d97' 
  AND (
    token = 'kYmpbmfkaLN3J9ot4Ju9nwgK2Qw9QQN6lxH/O+Cga1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038