UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0K8VPmQ0lUuxi16pfIJrm0TnTbeCdXf9X3l93I+yKPs=' 
WHERE 
  key_id = '3c33fae8a15b3ffdce2dfb992855ccb0e4ce11a4a103f3d43a1dc25ba611720e' 
  AND (
    token = '0K8VPmQ0lUuxi16pfIJrm0TnTbeCdXf9X3l93I+yKPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028