UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gT/ijolNwLYZig88a6Qm4rc3eV9kUgLQYnVjSSOJ1Qw=' 
WHERE 
  key_id = 'a4e0c6651c4549629061f5c9890a1d7e42a6c100edcf11b2c8e4cc757f75bb6d' 
  AND (
    token = 'gT/ijolNwLYZig88a6Qm4rc3eV9kUgLQYnVjSSOJ1Qw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030