UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9jtUgFWt4dorgTeQJaikGozQ5yRvpP308HmMCN9cRKI=' 
WHERE 
  key_id = '841cbf83d96b5b866b7e8f1432855965d54bddbe0cb1c8c3feaefe60b2a7ba07' 
  AND (
    token = '9jtUgFWt4dorgTeQJaikGozQ5yRvpP308HmMCN9cRKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030