UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uCqVSsgpEBMsatJ6Hxxn8h6LQulYQk9P+g2o4ZuYr8I=' 
WHERE 
  key_id = '8f2673200dcee1e4e5eed3490fd899a43d4216d6ecb9c5bf509e41ba5f1b5e44' 
  AND (
    token = 'uCqVSsgpEBMsatJ6Hxxn8h6LQulYQk9P+g2o4ZuYr8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054