UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'faN452gkgQoQX5kb9IIZb9s6vrlBlutyYHv5oAVMBnM=' 
WHERE 
  key_id = '093d71b4697c0abdcfdbc7247d32362b4648674224e17dadb9fb1992f2bf2601' 
  AND (
    token = 'faN452gkgQoQX5kb9IIZb9s6vrlBlutyYHv5oAVMBnM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014