UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IlOGc511ds/wWhwf826IOmp7qw7zzYsXEqBpnpStJuU=' 
WHERE 
  key_id = 'f1de17fd375c50a0defbe9406556e54e3ec00d9f1b60972a07dc4670e544ddb6' 
  AND (
    token = 'IlOGc511ds/wWhwf826IOmp7qw7zzYsXEqBpnpStJuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016