UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yZ0F5vV1etUHT6z54laFiGaOmqNCZu1sUWj6MCOgQNA=' 
WHERE 
  key_id = '6369680d6af61217df9114be9b8956368a14ae1d7dddb9405c9d7fc08e1955d8' 
  AND (
    token = 'yZ0F5vV1etUHT6z54laFiGaOmqNCZu1sUWj6MCOgQNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043