UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jpoTt7maqcI+7Qa/shTGpHJfh3zOQBO+CDnd8hxQPnc=' 
WHERE 
  key_id = '843c86856bec2004924be21a3d48cdc7f15af686031b7ed3ef8ffa3dae0a0e6a' 
  AND (
    token = 'jpoTt7maqcI+7Qa/shTGpHJfh3zOQBO+CDnd8hxQPnc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043