UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9rzyNIUR5MkXkvvdx8Gy11uFYdaOcHONLieboZ9Zrag=' 
WHERE 
  key_id = '92bb6c9805d12bba00f0d21f6eda00fc929f7a990d4e2e51b6c70e5d87eebeab' 
  AND (
    token = '9rzyNIUR5MkXkvvdx8Gy11uFYdaOcHONLieboZ9Zrag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053