UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Le4QiPnEKbELGuzc41JorAGaAfhXg0F0BgveIeMhHSU=' 
WHERE 
  key_id = '76f4d4b99ca3475c7aa2c82a70306dc80b8c59fb7bd108a225cca53f002a2467' 
  AND (
    token = 'Le4QiPnEKbELGuzc41JorAGaAfhXg0F0BgveIeMhHSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018