UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yk7qYG2rZ5Z/8zaCwrPdr4PZVEdIF710StjfOUYByvo=' 
WHERE 
  key_id = 'b28455812342251e611083b9a53bdc68dbb54919acc2c6bcee550816e0badeb7' 
  AND (
    token = 'yk7qYG2rZ5Z/8zaCwrPdr4PZVEdIF710StjfOUYByvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041