UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bOWv9AFCdqtruSFsLcOJdEhNtKkRnmcFG2/SFgPQePE=' 
WHERE 
  key_id = '6f44c4c108a3af16d5b6ea999e875f6ddb0b58ae1dfe6ee31d344f44509fa10d' 
  AND (
    token = 'bOWv9AFCdqtruSFsLcOJdEhNtKkRnmcFG2/SFgPQePE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049