UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wrGkDI2IWidUE3tSnU1ykcBX8D2+inKy21YEhGjcHEg=' 
WHERE 
  key_id = '0225454519c87435f85c7b0ed2094d5573f1f3ef7fde26554fa64dbb3d274c8f' 
  AND (
    token = 'wrGkDI2IWidUE3tSnU1ykcBX8D2+inKy21YEhGjcHEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025