UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mQ/Xyhlvn4su0RFm5o2bYSTtF7U1rNpIqaxEq3WF+vk=' 
WHERE 
  key_id = '32400f8d5b6ef41109c9be4ddc16e65fb1e185fe659f51017a00193fa8757674' 
  AND (
    token = 'mQ/Xyhlvn4su0RFm5o2bYSTtF7U1rNpIqaxEq3WF+vk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025