UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ojop9UTam/gqGIfqBAPKFOszoqWy5Ua49Gy7xdpRvfM=' 
WHERE 
  key_id = '32fe56c8d433befdcfbea0973a8591ec0fdd51830233cb2546d98ad62df8856e' 
  AND (
    token = 'ojop9UTam/gqGIfqBAPKFOszoqWy5Ua49Gy7xdpRvfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046