UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9+xXDHRcNF+rsHd7l0O97XZMWNn7GxeW0Zc2V4ZdxJk=' 
WHERE 
  key_id = '0967a668d4eec5fd9280f9290a69e8ead1515309c3a6782696ee6a7d71fe5d50' 
  AND (
    token = '9+xXDHRcNF+rsHd7l0O97XZMWNn7GxeW0Zc2V4ZdxJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031