UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rTsup0f1SluQdMHwr7EnwKd1hjseL4bQnj7HCWyqI8E=' 
WHERE 
  key_id = 'eb0466c2749ee3bcc466fac3469825133986dab03245a8dbc0ea0f7ad9452128' 
  AND (
    token = 'rTsup0f1SluQdMHwr7EnwKd1hjseL4bQnj7HCWyqI8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028