UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+Iz4WU3EMTM8ZKmuul3fbtOcAMLgQTOE0rbl/MtYa4g=' 
WHERE 
  key_id = '8c1cd802064299a6c645b56cd78ee6065054bbaded30dc3f69f6abbd45ee1bea' 
  AND (
    token = '+Iz4WU3EMTM8ZKmuul3fbtOcAMLgQTOE0rbl/MtYa4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031