UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/sBvQKZka6NnDAO5xarkhgi16Lg1nRuWxAKZApT6t74=' 
WHERE 
  key_id = '9434a65ccda1034cea4a2b3bbc3d21811fd023a2af336f69fd219a4f96b25fc8' 
  AND (
    token = '/sBvQKZka6NnDAO5xarkhgi16Lg1nRuWxAKZApT6t74=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023