UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qBdXswD/qBF11LbV4JJg2f0QJVqA881PR106T/tjXcE=' 
WHERE 
  key_id = '85d41a9eef62c78df5588a64404aa98e0b0b5c5ef0def124a935d241c9794f06' 
  AND (
    token = 'qBdXswD/qBF11LbV4JJg2f0QJVqA881PR106T/tjXcE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051