UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9uNB0Hk9cmpDg+VOIC+4+ED2jyUtk2dNE3RTWIZ9TG8=' 
WHERE 
  key_id = '54f3f67252d4fdc2b0a2ff5517c7b7ae644e23db388aca1b0c05a883feac1cfb' 
  AND (
    token = '9uNB0Hk9cmpDg+VOIC+4+ED2jyUtk2dNE3RTWIZ9TG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034