UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UbBi4PsocWhIIF2vISmB/x9dvYExxjvonhKGuduQo7I=' 
WHERE 
  key_id = '5ae2c675c232425fe07b16ebe132696f91f5e7c311c3a08ac5832ebd7daae621' 
  AND (
    token = 'UbBi4PsocWhIIF2vISmB/x9dvYExxjvonhKGuduQo7I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036