UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QuuiSkvs/6+ZXXkbVU8e99L7xbJMtD1Wgkyg3JiQ/Yo=' 
WHERE 
  key_id = 'c71c127a3d0fa32c311a674a65e60baa96d241873885de1d35c730069578fbb1' 
  AND (
    token = 'QuuiSkvs/6+ZXXkbVU8e99L7xbJMtD1Wgkyg3JiQ/Yo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024